SessionSubscriptions
The subscriptions of a protocol server, held apart for each client session.
继承自: Disposable
构造函数
public SessionSubscriptions(ILogReceiver logs)
sessionSubscriptions = SessionSubscriptions(logs)
The subscriptions of a protocol server, held apart for each client session.
- logs
- Where a message no single session can be told it is for is reported.
方法
public void Add(TSubscription info)
sessionSubscriptions.Add(info)
Adds a subscription to the session that opened it.
- info
- The subscription.
public void AddCommand(TSubscription info)
sessionSubscriptions.AddCommand(info)
Adds the subscription an order command runs under, taking its number over from an earlier command of the same session.
- info
- The command's subscription.
public void AddUnsubscribeRequest(TSession session, long transactionId, long originalTransactionId)
sessionSubscriptions.AddUnsubscribeRequest(session, transactionId, originalTransactionId)
Notes that a session asked to end one of its subscriptions.
- session
- The session.
- transactionId
- The number the ask runs under.
- originalTransactionId
- The number of the subscription it ends.
protected override void DisposeManaged()
sessionSubscriptions.DisposeManaged()
Disposes the managed resources. Override this method to add custom clean up of managed resources.
public IEnumerable<TSubscription> GetSubscriptions(TSession session)
result = sessionSubscriptions.GetSubscriptions(session)
The subscriptions of a session.
- session
- The session.
返回值: The subscriptions.
public TSubscription[] GetSubscriptions(TSession addressee, Message message)
result = sessionSubscriptions.GetSubscriptions(addressee, message)
The subscriptions a message goes to.
- addressee
- The session the module addressed it to, or for none.
- message
- The message.
返回值: The subscriptions.
public bool HasSubscriptions(DataType dataType, SecurityId securityId)
result = sessionSubscriptions.HasSubscriptions(dataType, securityId)
Whether any session watches a kind of data on a security.
- dataType
- The kind of data.
- securityId
- The security.
返回值: when one does.
public bool IsHeld(long id)
result = sessionSubscriptions.IsHeld(id)
Whether any session holds a subscription under a number.
- id
- The number.
返回值: when one does.
public bool IsHeldElsewhere(TSession session, long id)
result = sessionSubscriptions.IsHeldElsewhere(session, id)
Whether a number a session named is one only another session holds.
- session
- The session that named it.
- id
- The number.
返回值: when the session holds nothing under it and another session does.
public IEnumerable<TSubscription> Remove(TSession session)
result = sessionSubscriptions.Remove(session)
Removes everything a session subscribed to.
- session
- The session.
返回值: The subscriptions it held.
public void Remove(TSubscription info)
sessionSubscriptions.Remove(info)
Removes one subscription.
- info
- The subscription.
public bool TryGetById(TSession session, long id, TSubscription info)
result = sessionSubscriptions.TryGetById(session, id, info)
The subscription a session opened under a number.
- session
- The session.
- id
- The number.
- info
- The subscription.
返回值: when the session holds one under that number.
public bool TryGetSubscriptionAndStop(TSession session, long id, TSubscription info)
result = sessionSubscriptions.TryGetSubscriptionAndStop(session, id, info)
Stops the subscription a session opened under a number.
- session
- The session.
- id
- The number.
- info
- The subscription.
返回值: when the session held one under that number.
事件
public event Action<TSubscription> SubscriptionChanged
sessionSubscriptions.SubscriptionChanged += handler
A subscription changed its state.